import { getCodeTopic } from "../api/index";

export const action = {
  //加法
  increaseAction: { type: "increase" },
};

//异步获取数据
export const getCnodeTopic = async (dispatch) => {
  console.log("获取2");
  console.log("异步");
  const res = await getCodeTopic();
  console.log(res.data.data);
  dispatch(setCnodeDataList(res.data.data));
};

//同步获取数据
const setCnodeDataList = (data) => ({
  type: "setCnodeDataList",
  data,
});
